<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=seo_t(1);?></title>
<meta name="keywords" content="<?=seo_k(1);?>" />
<meta name="description" content="<?=seo_d(1);?>" />
<script src="<?=$base_view?>/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="<?=$base_view?>/js/jquery.highlight.js" type="text/javascript"></script>
<script src="<?=$base_view?>/js/Lazyload.js" type="text/javascript"></script>
<script src="<?=$base_view?>/js/inc.js" type="text/javascript"></script>
<style type="text/css"><?php $this->load->view("/css/inc_index_css");?></style>
<script type="text/javascript"><?php $this->load->view("/js/index_js");?></script>
<script src="<?=$base_url?>/cache/js/s_areadetail.js" type="text/javascript"></script>
<script src="<?=$base_url?>/cache/js/s_jiajuclass.js" type="text/javascript"></script>
<style type="text/css">
/* art_dialog */
/* alert box */
.popup {background:#FFF; border:5px solid #CCCCCC; padding:1px;}
.popup-header {height:24px; padding:7px; background:#F4F4F4;}
.popup-header h2 {margin:0; padding:0; font-size:18px; float:left;}
.popup-header .close-link {float:right; font-size:11px;}
.popup-body {padding:0px;}
.alert_div {
	width:400px;
	line-height:20px;
	overflow:hidden;
}
#alert_sonclass2 {
	display:none;
} 

.alert_div span {
	padding:5px;
}
.alert_div0 {
	word-wrap:break-word; 
	
}
.alert_mar {
	
	background:url(<?=$base_img?>/images/jiaju369/jt22.jpg) center center no-repeat;
	height:23px;
}

.alert_div1 {
	word-wrap:break-word; 
	background:#F4FAEC;
	border:1px solid #ccc; 
	padding:3px;
	

}
.alert_btn {
	margin:10px 10px;
	text-align:center;
}

.art_dialog {
	font-size:13px;
	color:#0000CC;
}
.art_dialog span {
	cursor:pointer;
}
.art_posi {
	height:22px;
	line-height:22px;
	background:#fff;
	border-bottom:1px solid #ccc;
}

.art_detail {
	padding:5px;
	line-height:18px;
	background:#fff;
}
.alert_div0 span {
	word-wrap:break-word; 

}
.art_close {
font-family:Verdana, Arial, Helvetica, sans-serif;
padding-right:12px;
float:right;
}
/* end art_dialog */
</style>
<script type="text/javascript">
<!--
//var t_areaObj = new Array();
//t_areaObj["0"]=new Array("上海","0","1");  // 名称，父id, id
//t_areaObj["1"]=new Array("浦东","1","2");
//t_areaObj["2"]=new Array("张江","2","3");
//t_areaObj["3"]=new Array("杨浦","1","4");
// 返回当前id下的子id内容 （区域）
function getSonClass(arrObj,selId){
		outStr  = "";
		outStr += "<div class=\"art_dialog\">";
		// 区域位置
		// 过滤	
		var region_Name = '';
		parent_Id = getParent_id(arrObj,selId);
		while( parent_Id  >1  ){	
			region_Name = " &gt; <span onclick=\"selectArea(this);\" name=\""+parent_Id+"\">"+ getName(arrObj,parent_Id) +"</span>" + region_Name;
			parent_Id = getParent_id(arrObj,parent_Id);
		}
		region_Name = "<span onclick=\"selectArea(this);\" name='1'>全国</span>"+region_Name;
		// selId = 1 表示全国
		if (selId != 1){
			nowName = getName(arrObj,selId);
			region_Name += ' &gt;<span onclick="selectArea(this);" name="'+selId+'"> '+ nowName + '</span>';
		}
		$('#art_posiCon').html(region_Name); // 确认后用户显示在页面中
		region_Name = "&nbsp;" + region_Name;
		outStr += '	<div id="art_posi" class="art_posi"><span class="art_close" onclick=\'sureArea();\' >X</span>'+ region_Name +'</div>';
		outStr += "	<div class=\"art_detail\">";
		// 当前区域的详细内容
		if (selId != 1)
		{
			outStr += "<span class='curent' onclick='sureArea();' >全"+ nowName +"</span> ";
		}

		// 过滤		
		var _outArr = $.grep(arrObj,function(val,key){
			return val[1] ==selId;
		
		});
		// 返回内容 
		$.each(_outArr,function(key,val){
			outStr +="<span onclick=\"selectArea(this);\" name='"+ val[2] +"'>"+ val[0] +"</span> ";
		});
		outStr += "</div></div>";
		return outStr;
}


	// ------------------------------------------------------------------------
	/**
		* 返回当前id下的子id内容 （家具类别）
	*/
	function getSonClass2(arrObj,selId){
			outStr  = "";
			outStr += "<div class=\"art_dialog\">";
			// 区域位置
			// 过滤	
			var region_Name = '';
			parent_Id = getParent_id(arrObj,selId);
			while( parent_Id  >1  ){	
				region_Name = " &gt; <span onclick=\"selectJClass(this);\" name=\""+parent_Id+"\">"+ getName(arrObj,parent_Id) +"</span>" + region_Name;
				parent_Id = getParent_id(arrObj,parent_Id);
			}
			region_Name = "<span onclick=\"selectJClass(this);\" name='1'>不限</span>"+region_Name;
			// selId = 1 表示全部家具
			if (selId != 1){
				nowName = getName(arrObj,selId);
				region_Name += ' &gt;<span onclick="selectJClass(this);" name="'+selId+'"> '+ nowName + '</span>';
			}
			$('#art_hotJJClassCon').html(region_Name); // 确认后用户显示在页面中
			region_Name = "&nbsp;" + region_Name;
			outStr += '	<div id="art_posi" class="art_posi"><span class="art_close" onclick=\'sureJclass();\' >X</span>'+ region_Name +'</div>';
			outStr += "	<div class=\"art_detail\">";
			// 当前区域的详细内容
			if (selId != 1)
			{
				outStr += "<span class='curent' onclick='sureJclass();' >所有"+ nowName +"</span> ";
			}
	
			// 过滤		
			var _outArr = $.grep(arrObj,function(val,key){
				return val[1] ==selId;
			
			});
			// 返回内容 
			$.each(_outArr,function(key,val){
				outStr +="<span onclick=\"selectJClass(this);\" name='"+ val[2] +"'>"+ val[0] +"</span> ";
			});
			outStr += "</div></div>";
			return outStr;
	}



	// ------------------------------------------------------------------------
	/*
		* 返回当前id的名称
	*/		
	function getName(arrObj,selId)	
	{
		var _outArr = $.grep(arrObj,function(val,key){
		return val[2] ==selId;
		});
		if (_outArr.length>0)
		return _outArr[0][0];
	}


	// ------------------------------------------------------------------------
	/*
		* 获得父id
	*/
	function getParent_id(arrObj,selId)
	{
		var _outArr = $.grep(arrObj,function(val,key){
		return val[2] ==selId;
		});
		if (_outArr.length>0)
		return _outArr[0][1];
	}	


	// ------------------------------------------------------------------------
	/*
		* 弹出层选择区域
	*/
	function selectArea(obj)
	{
		boxoff('idc');
		$(".areadetail span").removeClass("curent");
		$(obj).addClass("curent");
		var tName = $(obj).attr("name");
		$("#proarea").val(tName);
			boxon('idc');// 弹出层 
			setPos('hotarea','idc');// 定位

			$("#alert_div0").html(getSonClass(t_areaObj,tName));
			// 如果没有下一级别就关闭层
			var _outArr = $.grep(t_areaObj,function(val,key){
				return val[1] ==tName;});
			if ((_outArr.length)<1){sureArea();		}

	}
	

	// ------------------------------------------------------------------------
	/**
		* 弹出层选择家具类别
	*/
	function selectJClass(obj)
	{
		boxoff('idc');
		$(".JJClassDetail span").removeClass("curent");
		$(obj).addClass("curent");
		var tName = $(obj).attr("name");
		$("#classid").val(tName);

		boxon('idc');// 弹出层 
		setPos('hotJJClass','idc');// 定位

		$("#alert_div0").html(getSonClass2(t_jiajuclass,tName));
		// 如果没有下一级别就关闭层
		var _outArr = $.grep(t_jiajuclass,function(val,key){
			return val[1] ==tName;});
		if ((_outArr.length)<1){sureJclass();}


	}


	// ------------------------------------------------------------------------
	/**
		* 确认所选区域
	*/
	function sureArea()
	{
		boxoff('idc');
		if ($('#proarea').val() == "1")
		{		
			outhtml = $('#art_posiConDefault').html();
			$('#hotarea').removeClass('curent');
		}else
		{
			outhtml = $('#art_posiCon').html()
			$('#hotarea').addClass('curent');
		}
		$('#hotarea').html(outhtml);
		
	}

	// ------------------------------------------------------------------------
	/**
		* 确认所选家具类别
	*/
	function sureJclass()
	{
		boxoff('idc');
		if ($('#classid').val() == "0")
		{
			outhtml = $('#art_hotJJClassConDefault').html();
			$('#hotJJClass').removeClass('curent');
		}
		else
		{
			outhtml = $('#art_hotJJClassCon').html();
			$('#hotJJClass').addClass('curent');
		}
		$('#hotJJClass').html(outhtml);
		
	}
	

	// ------------------------------------------------------------------------
	/**
		* 筛选
	*/
	function fSearch()
	{
		chks(); // 过虑Keywords字符串
		upform('fSearch'); // 提交表单
	}
$(function(){

<?php
if ($k != ""):
echo <<<EOT
$(".proname").highlight("$k");
EOT;
endif;

?>

/* 搜索框 */
	$("#k").blur( function () {
		if($("#k").val()=="")
		{
			$('#k').css({
						"background-image":"url(<?=$base_img?>/images/bhss.gif)",
						"background-position":"2px center",
						"background-repeat":"no-repeat",
						"border-color":"#ddd",
						"background-color":'#fff'
			});	
		}
		else
		{
			$('#k').css({"border-color":"#7AAF3B",background:'#eff5e9'});
		}
	 } ); 
	 
	$("#k").focus( function () {
		$('#k').css({"border-color":"#7AAF3B",background:'#eff5e9'});
	});
	$('#k').blur();  // 页面载入触发该事件
/* end 搜索框 */


// 筛选显示/隐藏
	$("a.no").focus(function(){
		this.blur();
	});

	$("#btn_slide").click(function(){
		// alert(1);
		$("#panel").slideToggle("fast");
		//$(this).html("- 展开"); return false;
		if($('#shengshuo').val()==0)
		{
			$('#shengshuo').val(1);
			$(this).html("- 展开");
		}
		else
		{
			$('#shengshuo').val(0);
			$(this).html("+ 折叠");
		}
	
	});
	
/*
	筛选
*/	
	// 性 质
	$("#tr_1 span").click(function(){
		$("#tr_1 span").removeClass("curent");
		$(this).addClass("curent");
		$("#prosecond").val($(this).attr("name"));
	});
	
	
	// 价 格
	$("#tr_4 span").click(function(){
		$("#tr_4 span").removeClass("curent");
		$(this).addClass("curent");
		$("#price").val($(this).attr("name"));
	});	
	// 发布
	$("#tr_5 span").click(function(){
		$("#tr_5 span").removeClass("curent");
		$(this).addClass("curent");
		$("#probelong").val($(this).attr("name"));
	});	
	
	// 装载默认内容,在改变搜索条件时要调用
	$('#art_posiConDefault').html($('#hotarea').html());
	$('#art_hotJJClassConDefault').html($('#hotJJClass').html());
	
});
-->
</script>
<style type="text/css">
<!--
	#panel  {
		display:block;
	}
	#panel span {
		cursor:pointer;
		padding:2px 3px;
	}
	#btn_slide {
		cursor:pointer;
	}
	.content {
		width:auto;
		padding:0 10px;
	}

/* slistbody */
	.slistbody {
		clear:both;
		height:auto;
		padding-top:20px;
	}
	.slist_kuan {
			height:auto;
			padding-right:20px;
	}
	.kuantt,
	.kuansaixuan {
		border:1px solid #E3E3E3;
	}
	.kuantt {
		height:26px;
		line-height:26px;
		color:#6AA524;
		padding-left:20px;
		background:url(<?=$base_img?>/images/jiaju369/jt_03.jpg) 80px center no-repeat;
	}
	.kuansaixuan {
		background:#F4FAEC;
		height:auto;
		padding:10px 20px;
		border-top:0;
	}
	table.kuansaixuantable {
		
	}
	table.kuansaixuantable td {
		border-top:1px dashed #D6E8C1;
		letter-spacing:1px;
		padding:2px 0;
		vertical-align:top;
		line-height:18px;
	}
	table.kuansaixuantable td a{
		white-space:nowrap;
	}
	.curent {
		background:#67982D;
		color:white;
	}
	
	table.kuansaixuantable td.no1 {
		border-top:0;
	}
	table.kuansaixuantable td.column {
		font-weight:bold;
		color:#67982D;
		font-size:13px;
		width:60px;
		
	}
	
	.kuansaixuantable a:link,
	.kuansaixuantable a:visited,
	.kuansaixuantable a:hover,
	.kuansaixuantable a:active {
		text-decoration:none;
	}
	.kuansaixuantable a:hover {
		text-decoration:underline;
	}
	.kuansaixuantable a:visited {
		color:3E3E3E;
	}

/* kuanorder  */
	.kuanorder {
		height:28px;
		line-height:28px;
		border-bottom:1px solid #B5B5B5;
		margin-top:10px;
	}
	.canshu {
		float:left;
		
	}
	.canshu li {
		float:left;
		height:22px;
		line-height:22px;
		border:1px #E3E3E3 solid;
		border-bottom:0;
		margin:0 5px;
		padding:0 6px;
		margin-top:5px;
		background:url(<?=$base_img?>/images/jiaju369/bg_07.jpg) repeat-x;
	}
	.canshu li.no {
		background:none;
		border:0;
		font-size:13px;
		font-weight:bold;
		color:#67982D;
	}
	li.canshucurrent {
		border:1px #67982D solid;
		border-bottom:0;
		background:#67982D;
		color:white;
	}
	li.canshucurrent a {
		text-decoration:none;
		color:white;
	}
	.fenye {
		float:right;
		display:none;
		
	}
	.fenye li {
		float:left;
	}
/* /kuanorder  */
	.kuanadtop,
	.kuanadbottom {
		margin-top:10px;
		background:#FBF0FA;	
		display:none;
	}
	
	.kuanadtop li,
	.kuanadbottom li {
		height:50px;
		margin:5px 0;
		clear:both;
	}
	li.zanzu {
		height:18px;
		line-height:18px;
		text-align:right;
	}
/* /slistbody */
/* 列表分页 */ 
	#page{
		margin-top:15px;
		text-align:center;
		height:40px;
		line-height:40px;
	}
	#page a,
	#page strong {
	background: #ECF3FD;
	padding: 4px 5px;
	border: 1px solid #9EC9FE;
	color: #292929;
	font-size: 12px;
	
	}
	#page a:hover {
	background: #42B206;
	text-decoration: none;
	border: 1px solid #9FCD75;
	color:white;
	}
/* /列表分页 */ 
/* 搜索高亮 */
.highlight {color: #FF4E00; }
.areadetail {
	cursor:pointer;
}



-->
</style>

</head>
<body>
<div class="container">
	<?php $this->load->view('top_view');?>
	<!--  content   -->
    <div class="content">
			<?php $this->load->view('inc_search_list_view');?>
			<div class="slistbody">
			<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>
			<div class="slist_kuan">
				<div class="kuantt">
				<div style="float:right; height:25px; line-height:25px;"><input type="hidden" value="0" id="shengshuo" /><input style=" padding:0 10px; height:25px; margin:1px 10px; cursor:pointer;" name="" type="button" onclick="upform('fSearch');" value="筛 选" /><span id="btn_slide">+ 折叠</span>
				</div>分类筛选</div>
				<div id="panel" class="kuansaixuan">
				<table class="kuansaixuantable no">
				<tr id="tr_2"><td class="no1 column">
					类 别:
				</td><td class="no1">

					<span class="JJClassDetail" id="hotJJClass" style="padding-left:0;padding-right:0;">
						<span onclick="selectJClass(this);" name="0" class="curent">不限</span>  
						<span onclick="selectJClass(this);" name="12">电脑桌</span>  
						<span onclick="selectJClass(this);" name="7">办公椅</span>  
						<span onclick="selectJClass(this);" name="73">写字台</span>
						<span onclick="selectJClass(this);" name="78">餐桌</span>
						<span onclick="selectJClass(this);" name="54">展示柜</span>
						<span onclick="selectJClass(this);" name="8">屏风</span>
						<span onclick="selectJClass(this);" name="66">书柜</span>
						<span onclick="selectJClass(this);" name="65">电视柜</span>
						<span onclick="selectJClass(this);" name="2">办公家具</span>  
						<span onclick="selectJClass(this);" name="63">衣柜</span>  
						<span onclick="selectJClass(this);" name="72">沙发</span>  
						<span onclick="selectJClass(this);" name="71">床</span>  
						<span onclick="selectJClass(this);" name="1">其它</span>
					</span>
				</td></tr>
				<tr id="tr_3"><td class="column">
					区 域：
				</td><td>
					<span class="areadetail" id="hotarea" style="padding-left:0;padding-right:0;">
						<span onclick="selectArea(this);" name="1" class="curent">不限</span>  
						<span onclick="selectArea(this);" name="321">上海</span>  
						<span onclick="selectArea(this);" name="52">北京</span>  
						<span onclick="selectArea(this);" name="76">广州</span>  
						<span onclick="selectArea(this);" name="77">深圳</span>  
						<span onclick="selectArea(this);" name="383">杭州</span>  
						<span onclick="selectArea(this);" name="220">南京</span>  
						<span onclick="selectArea(this);" name="343">天津</span>  
						<span onclick="selectArea(this);" name="180">武汉</span>  
						<span onclick="selectArea(this);" name="1">其它</span>  
					</span>
					   
				</td></tr>
				<tr id="tr_4"><td class="column">
					价 格:
				</td><td>
					
					<?php
					function ifCSS($a,$b,$c){if($a == $b)	return "class='$c'";}
					foreach($price as $key=>$val):
							echo "<span ".ifCSS($key,$price_S,'curent')." name='$key'>$val</span> ";
					endforeach;?>
				</td></tr>
				<tr id="tr_5"><td class="column">
					发 布:
				</td><td>
					<?php foreach($probelong as $key=>$val):
							echo "<span ".ifCSS($key,$probelong_S,'curent')." name='$key'>$val</span> ";
					endforeach;?>

				</td></tr>
				<tr id="tr_1"><td class="column">
					性 质：
				</td><td >
					<?php foreach($prosecond as $key=>$val):
							echo "<span ".ifCSS($key,$prosecond_S,'curent')." name='$key'>$val</span> ";
					endforeach;?>
				</td></tr>
				</table>
				</div>
<?php
	if($count_all !=0):
?>				<div class="kuanorder">
					<div class="canshu">
						<ul class="no">
							<li class="no">排 序:</li>
							<li class="canshucurrent"><a href="javascript:;">上架时间</a></li>
<!--							<li><a href="">人 气</a></li>
							<li><a href="">价 格</a></li>-->
						</ul>
					</div>
					<div class="fenye">
					<ul class="no">
						<li>1/8</li>
						<li>上一页</li>
						<li>下一页</li>

					</ul>
					</div>
				</div>
				<div class="kuanadtop">
					<ul class="no">
						<li class="zanzu">赞助商链接&nbsp;</li>
						<li> </li>
						<li> </li>
						<li> </li>
					</ul>
				</div>
				<div class="kuanlist lazy">

					<ul class="no">
<?php
$i = 0;
foreach($listpro->result() as $row):
?>					
<li>
	<div class="Wkuang">
	<table width="231" height="220" class="no"><tr><td align="center" valign="middle">
<a target="_blank" class="no" href="<?=$base_header?>/home/show/<?=$row->probelong?>/<?=$row->proid?>.html" title="<?=$row->proname?>" >
		<img class="no" alt="<?=$row->proname?>"  id="img<?=$i?>"  
		original="<?php if (empty($row->picpath)) { echo $base_img1.imgurl($row->probelong).'/'.dst_img(getfirstp($row->pic));}else {echo $row->picpath.dst_img(getfirstp($row->pic));}?>" />
	</a>
</td></tr></table>


	</div>
	<div style="margin:5px 18px;">
		<a target="_blank" href="<?=$base_header?>/home/show/<?=$row->probelong?>/<?=$row->proid?>.html" title="<?=$row->proname?>" ><span class="proname"><?=utf8_strcut($row->proname,0,35)?></span></a>
	</div>
	<div class="ftime">
	￥：<span class="Money"><?=$row->price?>.00</span> [<?=$row->probelong1?> <span class="of"><?=$row->update?></span>]
	</div>
</li>

<?php
$i++;
endforeach;
?>						

					</ul>	
<?php
else:
$outshow = '';
if ($k !='') $outshow .= "<li>关键词为： $k</li>";
if ($prosecond_S 	!='0') $outshow .= "<li>性质为：". $prosecond[$prosecond_S]."</li>";
if ($classid_S 		!='0') $outshow .= "<li>家具分类为：<script>D(getName(t_jiajuclass,$classid_S));</script></li>";
if ($proarea_S 		!='1' && $proarea_S !='0') $outshow .= "<li>所在区域为：<script>D(getName(t_areaObj,$proarea_S));</script></li>";
if ($price_S 		!='0') $outshow .= "<li>价格为：". $price[$price_S]."</li>";
if ($probelong_S 	!='0') $outshow .= "<li>发布： ".$probelong[$probelong_S]."</li>";

	echo <<<EEE
	<div style='height:auto; line-height:25px; margin-left:30px; margin-top:30px;' class='font_2'>
	抱歉，没有找到以下条件：<br />
	<ol>
	$outshow 
	</ol>
	相关的家具信息!</div>
EEE;

endif;
?>
				</div>
				<div class="kuanadbottom">
					<ul class="no">
						<li class="zanzu">赞助商链接&nbsp;</li>
						<li></li>
						<li></li>
						<li></li>
					</ul>	
				</div>
				<div class="splitpage"><?=$page?></div>
			</div>

			</td><td width="225" valign="top">
<?php $this->load->view('inc_rightad_view');?>
			</td></tr></table>
			</div>
    </div>
	<!--  /content   -->
	<?php $this->load->view('footer_view');?>
</div>

</div>
<script type="text/javascript">
$(".lazy img").lazyload({
	placeholder: "<?=$base_img?>/images/o_loading.gif",
	effect:"fadeIn",
	rheight:231,
	rwidth:220
  }); 
</script>
<?php
$con = '<div id="alert_div0" class="alert_div0" >< span class="areadetail"></span></div>';
echo box_newbox('idc','',$con);
?>
<?php /*用来存储 选择的区域*/ ?>
<div id="art_posiCon" style="display:none;"></div>
<div id="art_posiConDefault" style="display:none;"></div>
<div id="art_hotJJClassCon" style="display:none;"></div>
<div id="art_hotJJClassConDefault" style="display:none;"></div>
<?php
// 搜索用。当有搜索分类的时候，就要显示所选择的分类
if($classid_S != '0') echo "<script>getSonClass2(t_jiajuclass,$classid_S);sureJclass();</script>";
if($proarea_S != '1' && $proarea_S != '0') echo "<script>getSonClass(t_areaObj,$proarea_S);sureArea();</script>";
?>
</body>
</html>


